package cn.pid21.client.model.cstr;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.github.liaochong.myexcel.core.annotation.ExcelColumn;
import com.github.liaochong.myexcel.core.annotation.IgnoreColumn;
import lombok.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * cstr 元数据
 * 
 * @author 李世坚
 * @version 1.1.0
 * @date 2020/07/13
 */
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Data
public class Metadata implements CommonMetadata{

    /**
     * id
     */
    @IgnoreColumn
    private String id;

    /**
     * 中文名称
     */
    @ExcelColumn(index = 1,order = 0, title = "中文名称")
    @NotBlank(message = "titleZh Is Not Empty")
    @JacksonXmlProperty(localName = "title_zh")
    private String titleZh;

    /**
     * CSTR 标识符
     */
    @ExcelColumn(index = 3,order = 2, title = "标识符")
    @NotBlank(message = "cstr Is Not Empty")
    @JacksonXmlProperty
    private String cstr;

    /**
     * 资源类型
     */
    @IgnoreColumn
    @NotBlank(message = "resourceType Is Not Empty")
    @JacksonXmlProperty(localName = "resource_type")
    private String resourceType;

    /**
     *最近提交日期
     */
    @NotBlank(message = "submitTime Is Not Empty")
    @JacksonXmlProperty(localName = "submit_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date submitTime;
    /**
     * 科技资源描述
     */
    @NotBlank(message = "description Is Not Empty")
    @ExcelColumn(index = 7,order = 6, title = "描述信息")
    @JacksonXmlProperty(localName = "description")
    private String description;
    /**
     * 提交机构
     */
    @JacksonXmlProperty(localName = "submit")
    private Submit submit;

    /**
     * 关键字
     */
    @NotBlank(message = "keywords Is Not Empty")
    @JacksonXmlElementWrapper(localName = "keywords")
    @JacksonXmlProperty(localName = "keyword")
    private List<String> keywords;
    /**
     * 资源信息链接地址
     */
    @IgnoreColumn
    @NotNull(message = "urls Is Not Empty")
    @JacksonXmlElementWrapper(localName = "urls")
    @JacksonXmlProperty(localName = "url")
    private List<String > urls;

    /**
     * 发布时间
     */
    @IgnoreColumn
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JacksonXmlProperty(localName = "publication_time")
    private Date publicationTime;
    /**
     * 注册机构名称
     */
    @NotBlank(message = "registerOrgName Is Not Empty")
    @JacksonXmlProperty(localName = "register_org_name")
    private String registerOrgName;
    /**
     * 引用科技资源标识符
     */
    @JacksonXmlProperty(localName = "pid")
    private String pid;
    /**
     * 科技资源引用标注建议_系统自动生成
     */
    @JacksonXmlProperty(localName = "labeling_suggestions")
    private String labelingSuggestions;
//
//    /**
//     * 状态
//     */
//    private int status;
//
//    /**
//     * 解析次数
//     */
//    private long resolveCount;
//    /**
//     * 访问次数
//     */
//    private long viewCount;
//    /**
//     * 用户账号
//     */
//    private String userName;
//    /**
//     * 机构名称
//     */
//    private String nameZh;
//    /**
//     * 标识符状态 0-草稿,1-可注册,2可发现
//     */
//    private int identificationStatus = 2;

}
